﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Coslen.TahorCRM.Domain.Entities.ViewModels.Searching;
using Coslen.TahorCRM.Domain.Services.Concretes;
using Ninject;
using Coslen.TahorCRM.Domain.Model.Entities;

namespace Coslen.TahorCRM.UI.www.Areas.Groups.Controllers
{
    public class GroupContactController : Controller
    {

        [Inject]
        public GroupContactService GroupContactService { get; set; }
        //
        // GET: /Groups/GroupContact/

        public ActionResult EditList(int groupId)
        {
            var model = new GroupContactSearchViewModel();
            model.GroupId = groupId;
            model.PageSize = 100000; // arbitary large number indicating all people
            model = GroupContactService.GetGroupContactSearchViewModel(model);

            return View(model);
        }

        [HttpPost]
        public ActionResult EditList(List<GroupContact> contactList)
        {
            return RedirectToAction("Index", "Group");
        }
    }
}
